<?php
session_start();
?>
<html>

<head>
<?php $a[2] = "active"; ?>
<?php
include ('head.php');
?>

</head>

<body>
		
<?php
include ('dbcon.php');
include ('webtitle.php');
include ('topbannermenu.php');
include ('leftmenu.php');
include ('rightmenu.php');

?>	
   
<div id = "divMid">
<br>
       <div id = "pro4">
<div id = "mheader">

		<span>
        Sản Phẩm Siêu Cấp
        </span>
		</div>
		<table class="show" width="97%" border="0" align="center" >
        <tr align="center">
         <?php
		 $x = 0;
        // put your code here
		
		$DT = mysql_query("select * from sanpham where gia >= 10000000");
		while ($row = mysql_fetch_array($DT))
		{
			$x+=1;
		?>
        <td  class="show">
		  
		    <?php echo "<font color='#000' size='2px'><label class='tendt' ><strong><u><p><a href='detail.php?madt=$row[0]'> $row[1] </strong></label></a></p></u></font>";?>
	      
		  <p><br/>
	      <?php echo "<a href='detail.php?madt=$row[0]'><img src ='$row[4]' width ='70' height ='95'></a>"?></p>
		  <br/>
		    <font color="#FF0000" size="3px"><label class="gia"><strong><?php echo "". number_format($row[3],0) ."đ";?>
	        </strong></label></font>
            <table border="0" width ="97%" >
            <tr><td >
           <?php 
			$SLTK = 0;
			$sqlSLTK = mysql_query("select soluongtonkho from sanpham where masp = $row[0]");
			while ($rowSLTK = mysql_fetch_array($sqlSLTK))
			{
				$SLTK = $rowSLTK[0];
			}
			
			if($SLTK > 0){ echo "<form action='addDT.php?item=$row[0]' method ='post'>" ?>
            
		    <input name="btn_MuaHang" type="submit" class="btmua" id="btn_MuaHang" value=" Mua Ngay "  >
            </form>
            <?php }
			else
		
			{
				echo "<form action='detail.php?madt=$row[0]' method ='post'>" ?>
            
		    <input name="btn_Het" type="submit" class="bthet" id="btn_Het" value=" Hết Hàng "  >
            </form>	
			<?php } ?>
            </td>
            </tr>
			</table>
		 </td>
		 
		 <?php
		 if($x ==3)
		 {
			 $x = 0;
			 ?>
             </tr>
			 <tr align="center">
         <?php
        }
	
		}  ?>
        </table> 
		<div id = "mheader">
		<span>
        Sản Phẩm Cao Cấp
        </span>
		</div>
        <table class="show" width="97%" border="0" align="center" >
        <tr align="center">
         <?php
		 $x = 0;
        // put your code here
		$DT = mysql_query("select * from sanpham where gia between 5000000 and 10000000");
		while ($row = mysql_fetch_array($DT))
		{
			$x+=1;
		?>
        <td  class="show">
		  
		    <?php echo "<font color='#000' size='2px'><label class='tendt' ><strong><u><p><a href='detail.php?madt=$row[0]'> $row[1] </strong></label></a></p></u></font>";?>
	      
		  <p><br/>
	      <?php echo "<a href='detail.php?madt=$row[0]'><img src ='$row[4]' width ='70' height ='95'></a>"?></p>
		  <br/>
		    <font color="#FF0000" size="3px"><label class="gia"><strong><?php echo "". number_format($row[3],0) ."đ";?>
	        </strong></label></font>
            <table border="0" width ="97%" >
            <tr><td >
            <?php 
			$SLTK = 0;
			$sqlSLTK = mysql_query("select soluongtonkho from sanpham where masp = $row[0]");
			while ($rowSLTK = mysql_fetch_array($sqlSLTK))
			{
				$SLTK = $rowSLTK[0];
			}
			
			if($SLTK > 0){ echo "<form action='addDT.php?item=$row[0]' method ='post'>" ?>
            
		    <input name="btn_MuaHang" type="submit" class="btmua" id="btn_MuaHang" value=" Mua Ngay "  >
            </form>
            <?php }
			else
		
			{
				echo "<form action='detail.php?madt=$row[0]' method ='post'>" ?>
            
		    <input name="btn_MuaHang" type="submit" class="btmua" id="btn_MuaHang" value=" Hết Hàng "  >
            </form>	
			<?php } ?>
            </td>
            </tr>
			</table>
		 </td>
		 
		 <?php
		 if($x ==3)
		 {
			 $x = 0;
			 ?>
             </tr>
			 <tr align="center">
         <?php
        }
	
		}  ?>
        </table> 
		<div id = "mheader">
		<span>
        Sản Phẩm Phổ Thông
        </span>
		</div>
        <table class="show" width="97%" border="0" align="center" >
        <tr align="center">
         <?php
		 $x = 0;
        // put your code here
		$DT = mysql_query("select * from sanpham where gia < 5000000");
		while ($row = mysql_fetch_array($DT))
		{
			$x+=1;
		?>
        <td  class="show">
		  
		    <?php echo "<font color='#000' size='2px'><label class='tendt' ><strong><u><p><a href='detail.php?madt=$row[0]'> $row[1] </strong></label></a></p></u></font>";?>
	      
		  <p><br/>
	      <?php echo "<a href='detail.php?madt=$row[0]'><img src ='$row[4]' width ='70' height ='95'></a>"?></p>
		  <br/>
		    <font color="#FF0000" size="3px"><label class="gia"><strong><?php echo "". number_format($row[3],0) ."đ";?>
	        </strong></label></font>
            <table border="0" width ="97%" >
            <tr><td >
            <?php 
			$SLTK = 0;
			$sqlSLTK = mysql_query("select soluongtonkho from sanpham where masp = $row[0]");
			while ($rowSLTK = mysql_fetch_array($sqlSLTK))
			{
				$SLTK = $rowSLTK[0];
			}
			
			if($SLTK > 0){ echo "<form action='addDT.php?item=$row[0]' method ='post'>" ?>
            
		    <input name="btn_MuaHang" type="submit" class="btmua" id="btn_MuaHang" value=" Mua Ngay "  >
            </form>
            <?php }
			else
		
			{
				echo "<form action='detail.php?madt=$row[0]' method ='post'>" ?>
            
		    <input name="btn_MuaHang" type="submit" class="btmua" id="btn_MuaHang" value=" Hết Hàng "  >
            </form>	
			<?php } ?>
            </td>
            </tr>
			</table>
		 </td>
		 
		 <?php
		 if($x ==3)
		 {
			 $x = 0;
			 ?>
             </tr>
			 <tr align="center">
         <?php
        }
	
		}  ?>
        </table> 
  </div>
  </div>
		<div class="clr"></div>
		<?php 
		include ('footer.php');
		?>
</body>
</html>